<template>
	<view class="article">
		<u-navbar 
			:is-fixed="false" 
			background="{ background:'#1a162d'}" 
			title-color="#fff" :immersive="true" :title="article.title" :border-bottom="false"></u-navbar>
		<view class="box">
			<view class="article_time">{{article.update_time}}</view>
			<view class="article_content">
				<view v-html="article.content"></view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id: 0,
				article:{},
			}
		},
		onLoad(option) {
			console.log("=================");
			console.log(option);
			this.id = option.id;
			if(this.id){
				this.details();
			}
		},
		methods: {
			details(){
				let that = this;
				this.$http({
					url: "api/Article/agreement?id=" + this.id,
				}).then(res => {
					console.log(res);
					if (res.data.code == 1) {
						 uni.setNavigationBarTitle({
						      title: res.data.data.title
						});
						that.article = res.data.data
					} else {
						this.$tip.tip(res.data.msg)
						this.show = true
					}
				}).catch(err => {});
			}
		}
	}
</script>

<style lang="scss" scoped>
.article{ 
	min-height: 100vh;
	padding:10px; background:#0D0D0D; color: #eee;
	.article_title{ font-size: 18px; text-align: center; margin:10px 0; }
	.article_time{ text-align: center; line-height: 22px; }
	.article_content{ font-size: 13px; margin-top:10px; }
}
</style>
